<admintpl file="header" />
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>跑客详情统计</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('Bdrunpeople/pnall_info_list')}">
        团队：
        <select class="select_2" name="formget[company_id]"  style="width: 105px;" >
            <volist name="company_data" id="vo">
                <if condition="$formget.company_id == $vo[company_id]">
                    <option value="{$vo.company_id}" selected>{$vo.company_name}</option>
                    <else /><option value="{$vo.company_id}" >{$vo.company_name}</option>
                </if>
            </volist>
        </select>
        姓名：<input type="text" name="formget[dispatch_name]" style="width: 80px;" value="{$formget.dispatch_name}" placeholder="请输入关键字...">
        签约时间：
        <input type="text" name="formget[sign_start_time]" class="js-date" value="{$formget.sign_start_time|default=''}" style="width: 85px;" autocomplete="off">-
        <input type="text" class="js-date" name="formget[sign_end_time]" value="{$formget.sign_end_time}" style="width: 85px;" autocomplete="off">
        订单完成时间：
        <input type="text" name="formget[start_time]" class="js-date" value="{$formget.start_time|default=''}" style="width: 85px;" autocomplete="off">-
        <input type="text" class="js-date" name="formget[end_time]" value="{$formget.end_time}" style="width: 85px;" autocomplete="off">
        &nbsp;&nbsp;
        降序排序：
        <select class="select_2" name="formget[order_str]"  style="width: 105px;" >
                <if condition="$formget[order_str] == 'finish_count'">
                    <option value="finish_count" selected>完成订单数</option>
                    <else /><option value="finish_count" >完成订单数</option>
                </if>
                <if condition="$formget[order_str] == 'onlinetime'">
                    <option value="onlinetime" selected>累计时长</option>
                    <else /><option value="onlinetime" >累计时长</option>
                </if>
                <if condition="$formget[order_str] == 'todaytime'">
                    <option value="todaytime" selected>今日在线</option>
                    <else /><option value="todaytime" >今日在线</option>
                </if>
            </volist>
        </select>
        <input type="submit" class="btn btn-primary" value="搜索" />
    </form>
    <php>$order_sucess_count = $order_data[0]['order_counts'] ;//完成的单子数
         $order_fail_count = $order_data[1]['order_counts'];//取消的单子数
        if($order_sucess_count== null || $order_sucess_count =="")
            $order_sucess_count = 0;
        if($order_fail_count== null || $order_fail_count =="")
            $order_fail_count = 0;
        $order_count= $order_sucess_count + $order_fail_count;//总单子数
    </php>
    <table width="100%">
        <tr><td>总数：{$total_count}人【注意：列表中完成订单数与日期有关，其余值都是截止到今日的总值】</td>
            <td>当日下单量：{$order_count} 单</td>
            <td align="center">当日流单量：{$order_fail_count} 单</td>
        </tr>
    </table>
    <form method="post" class="js-ajax-form">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th align="center">序号</th>
                <th>所属团队</th>
                <th>所属分公司</th>
                <th>推荐人姓名</th>
                <th>跑客姓名</th>
                <th>跑客电话</th>
                <th>工作状态</th>
                <th>是否接受指派</th>
                <th>完成订单数</th>
                <th>完成订单金额</th>
                <th>推荐用户数</th>
                <th>推荐跑客数</th>
                <th>推荐用户下单量</th>
                <th>累计时长</th>
                <th>今日在线</th>
            </tr>
            </thead>
            <tbody>
            <php> $work_status=array("0"=>'否','1'=>'是');</php>
            <foreach name="lists" item="vo" key="k">
                <tr>
                    <td align="center">{$k+1}</td>
                    <td>{$vo[company_id]|getCompanyName}</td>
                    <td>{$vo.company_branch|get_combranch_name}</td>
                    <td>{$vo.dispatch_id|getPnRecommend}</td>
                    <td>{$vo.dispatch_name}</td>
                    <td>{$vo.mobile}</td>
                    <td>{$work_status[$vo[work_status]]}</td>
                    <td>{$work_status[$vo[is_accept_dispatch]]}</td>
                    <td>{$vo.finish_count}</td>
                    <td>{$vo.finish_amount}</td>
                    <td>{$vo[dispatch_id]|get_recommended_person_count=###,2,1}</td>
                    <td>{$vo[dispatch_id]|get_recommended_person_count=###,2,2}</td>
                    <td>{$vo[dispatch_id]|get_recommended_person_order_count=###,2,1}</td>
                    <!--<td>{$vo[dispatch_id]|get_dispatch_finish_order=###,$formget['start_time'],$formget['end_time']}</td>-->
                    <td>{$vo[onlinetime]}</td>
                    <td>{$vo[todaytime]}</td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <if condition="empty($lists)">
            <div style="padding: 30px;text-align: center;color: #999999">
                <i class="fa fa-database" style="font-size: 38px"></i><br />
                暂无数据
            </div>
        </if>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
    setCookie('refersh_time', 0);
    function refersh_window() {
        var refersh_time = getCookie('refersh_time');
        if (refersh_time == 1) {
            window.location = "{:U('Bdrunpeople/order',$formget)}";
        }
    }
    setInterval(function() {
        refersh_window();
    }, 2000);
    $(function() {
        setCookie("refersh_time", 0);
        Wind.use('ajaxForm', 'artDialog', 'iframeTools', function() {
            //批量移动
            $('.js-articles-move').click(function(e) {
                var str = 0;
                var id = tag = '';
                $("input[name='ids[]']").each(function() {
                    if ($(this).attr('checked')) {
                        str = 1;
                        id += tag + $(this).val();
                        tag = ',';
                    }
                });
                if (str == 0) {
                    art.dialog.through({
                        id : 'error',
                        icon : 'error',
                        content : '您没有勾选信息，无法进行操作！',
                        cancelVal : '关闭',
                        cancel : true
                    });
                    return false;
                }
                var $this = $(this);
            });
        });

    });

    function push_reload(order_id){
        layer.open({
            type: 2,
            title: '重新发单提示',
            shadeClose: true,
            shade: 0.8,
            area: ['380px', '30%'],
            content: '{:U("Bdrunpeople/push_server_data")}&order_id='+order_id+'&formget=I("formget"))}"' //iframe的url
        });

    }
</script>
</body>
</html>